﻿using EaseDapper.Enums;
using EaseDapper.Constants;

namespace EaseDapper
{
    public class ConnectConfig
    {
        private string _bdType;
        /// <summary>
        /// 数据库类型
        /// </summary>
        public string DbType
        {
            get => _bdType;
            set
            {
                _bdType = value.Trim().ToUpper() switch
                {
                    DialectNames.MYSQL => Dialect.MySql.ToString(),
                    DialectNames.SQLSERVER => Dialect.SqlServer.ToString(),
                    DialectNames.SQLITE => Dialect.Sqlite.ToString(),
                    DialectNames.ORACLE => Dialect.Oracle.ToString(),
                    DialectNames.POSTGRESQL => Dialect.PostgreSQL.ToString(),
                    _ => value,
                };
            }

        }
        /// <summary>
        /// 连接字符串
        /// </summary>
        public string ConnectString { get; set; }
    }
}
